package com.kerrykidz.system.util.quartz;


import java.util.Date;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.kerrykidz.parreserve.service.IParReserveService;
import com.kerrykidz.system.util.DateUtil;
import com.rdp.util.config.SpringUtil;

/**
 * 派对定时 每隔30分钟，自动取消大于24小时 未预付 的 派对信息
 * ParReserveQuartz
 * @author rain
 *
 */
public class ParReserveQuartz extends QuartzJobBean {
	protected void executeInternal(JobExecutionContext arg0)
			throws JobExecutionException {
		 try {  
			 IParReserveService parReserveService = SpringUtil.getBeanByType(IParReserveService.class);
//			 String dateTime =DateUtil.addHour2DateToString(-24, new Date(), "yyyy-MM-dd HH:mm");
			 parReserveService.updateParReserveAutoCancel(null);
        	// System.out.println("24小时 未预付 的 派对预约定时更改 状态 为:2 自动取消"); 
        } catch (Exception e) {  
            e.printStackTrace();  
        } 
	}


 
	
	 
}
